#define _CRT_SECURE_NO_WARNINGS 1

#include "SList.h"

Listnode* Middlenode(Listnode* phead)
{
	Listnode* plow, * pfast;
	plow = pfast = phead;

	while (pfast && pfast->next)
	{
		plow = plow->next;
		pfast = pfast->next->next;
	}
	return plow;
}

int main()
{
	Listnode* phead = NULL;
	Listpushback(&phead, 1);
	Listpushback(&phead, 2);
	Listpushback(&phead, 3);
	Listpushback(&phead, 4);
	Listpushback(&phead, 5);
	Listpushback(&phead, 6);
	Listnode* midnode = Middlenode(phead);
	printf("%d\n", midnode->data);

	return 0;
}